import request from '../utils/request'

// 验证手机号
export const verifyPhone = phone => request.get('/api/users/' + phone)

// 获取验证码
export const fetchCode = phone => request.get(`/api/users/${phone}/code`)

// 校验验证码
export const checkCode = (phone, code) => request.get(`/api/users/${phone}/verifycode?code=${code}`)

// 注册
export const register = (phone, password) => request({
    url: '/api/users/register',
    method: 'POST',
    data: {
        phone,
        password
    }
})